<?php


namespace App\Exceptions;


use App\Http\Controllers\Controller;
use Throwable;

/**
 * 参数错误抛出
 * Class ParamException
 * @package App\Exceptions
 */
class ParamException extends BaseException
{
    protected $message = '';

    protected $code = 200;


    public function __construct($message = '', $code = 0, Throwable $previous = null)
    {
        parent::__construct($message, $code, $previous);
    }


    /**
     * 处理异常数据
     */
    public function report()
    {
        //  dd($this->getMessage());
    }

    /**
     * 响应
     * @param $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function render($request)
    {
        return (new Controller())->error([], $this->message);
    }
}